<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<!--[if lt IE 9]>
	<script type="text/javascript" src="lib/html5.js"></script>
	<script type="text/javascript" src="lib/respond.min.js"></script>
	<script type="text/javascript" src="lib/PIE_IE678.js"></script>
	<![endif]-->
	<link href="__PUBLIC__/css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
	<link href="Tpl/Service/common/center/choice.css" rel="stylesheet" type="text/css" />
	<!--[if IE 6]>
	<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
	<script>DD_belatedPNG.fix('*');</script>
	<![endif]-->
	<title>短信管理</title>
</head>
<body>
	<div class="head">
		<div class="head-content">
			<div class="row">
				<div class="col-2"><p>客户信息</p></div>
				<div class="col-10 text-r">
					<div class="head-sub1 head-sub borderR"><i class="Hui-iconfont Hui-iconfont-order"></i>工单统计</div>
					<div class="head-sub2 head-sub borderR"><i class="Hui-iconfont Hui-iconfont-dangan"></i>知识库</div>
					<div class="head-sub3 head-sub borderR"><i class="Hui-iconfont Hui-iconfont-comment"></i>待处理 {$count.ing}</div>
					<div class="head-sub4 head-sub borderR"><i class="Hui-iconfont Hui-iconfont-yiguanzhu1"></i>已处理 {$count.ed}</div>
					<div class="head-sub4 head-sub userName">{$user.real_name}</div>
					<div class="head-sub4 head-sub"><i class="Hui-iconfont Hui-iconfont-daochu"></i><a href="{:U('Admin/Index/loginOut')}">退出</a></div>
				</div>
			</div>
		</div>
	</div>
	<div class="nav">
		<div class="nav-content">
			<div class="nav-tel">
				<i class="Hui-iconfont Hui-iconfont-tel2"></i>&nbsp;<span class="inTel"></span>接通中···
			</div>
			<div class="nav-search">
				<form action="" method="post">
					电话：<input type="text" class="input-text" id="searchTel">
					姓名：<input class="input-text" id="searchName">
					<span class="btn btn-primary radius btn_h" id="search">搜索</span>
				</form>
			</div>
			
		</div>
	</div>

	<div class="content">
		<div class="row content-line1">
			<div class="left">
				<i class="Hui-iconfont Hui-iconfont-user"></i>&nbsp;客户信息
			</div>
			<div class="right">
				<a href="javascript:;" class="blue" id="createCustomer">创建用户</a>
				<a href="javascript:;">切换用户({$customer|count})<i class="Hui-iconfont Hui-iconfont-arrow3-bottom"></i></a>
				
			</div>
		</div>
		<div class="row content-line2">
			<p>有{$customer|count}个用户包含了该来电号码，请根据用户提供的信息选择其中正确的一个</p>
		</div>
		<div class="row content-customer">
		<!-- 循环div -->
			<volist name="customer" id="vo" empty="无业主信息">
				<div class="content-sub col-4 wid2">
					<if condition="$vo['sex'] eq 'M'">
						<div class="manBorder">
					<else/>
						<div class="womanBorder">
					</if>
					
						<div class="content-padding">
							<div class="row customerInfo">
								<span class="customerNmae">{$vo.name}</span>
								<if condition="$vo['sex'] eq 'M'">
									<img src="Tpl/Service/common/sms/man.jpg">
								<else/>
									<img src="Tpl/Service/common/sms/woman.jpg">
								</if>
								
								<span class="customerType">{$vo.ugroup}</span><span class="customerStat">待验证</span>
							</div>
							<div class="row familyInfo">
								家庭信息({$vo.families|count})
							</div>
							<div class="row homeBorder">
								<volist name="vo['families']" id="ko" empty="无家庭">
									<i class="Hui-iconfont Hui-iconfont-home"></i> {$ko.address}
								</volist>	
							</div>
						</div>
						<if condition="$vo['sex'] eq 'M'">
							<div class="divBtn">
						<else/>
							<div class="wodivBtn">
						</if>
						
							<div class="col-6 divBtnL wid" uid="{$vo.id}">
								更多信息
							</div>
							<div class="col-6 divBtnR">
								<a href="/index.php?m=Service&c=Center&a=index&tel={$vo.tel}" target="_self">选择为来电用户<a>
							</div>
						</div>
					</div>
				</div>
			</volist>
		
			<!-- 循环div结束 -->
			
		</div>
	</div>
	<script type="text/javascript" src="__PUBLIC__/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/lib/Validform/5.3.2/Validform.min.js"></script> 
	<script type="text/javascript" src="__PUBLIC__/lib/layer/2.1/layer.js"></script>
	<script type="text/javascript" src="__PUBLIC__/lib/icheck/jquery.icheck.min.js"></script> 
	<script type="text/javascript" src="__PUBLIC__/js/H-ui.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/H-ui.admin.js"></script>
	<script src="http://cdn.bootcss.com/jquery.form/3.51/jquery.form.min.js"></script>
<!--	<script type="text/javascript" src="Tpl/Service/common/center/choice.js"></script>-->
	<script type="text/javascript" src="__PUBLIC__/js/getUrl.js"></script> 
	<script type="text/javascript">
		// 全局
		var info={
			tel:""//呼入用户手机号
		}
		$(function(){
			info.tel=$.getUrlVar('tel');
			work.init();
		});
        
        var work={
	/*·····························初始化························*/
	init:function(){
		this.eventListen();
		$(".inTel").text(info.tel);
	},
	/*·····························事件监听························*/
	eventListen:function(){
		// 创建用户
		$(document).on("click","#createCustomer",function(){
			$.post("/index.php?m=Admin&c=Customer&a=add",{tel:info.tel},function(data){
				if(data.stat==1){
					work.layerOpen('创建用户','/index.php?m=Service&c=Center&a=create&tel='+info.tel+'&customerId='+data.id);
				}else{
					layer.msg(data.msg);
				}
			});
		});
		//查看用户
		$(document).on("click",".divBtnL",function(){
			var uid=$(this).attr("uid");
			work.layerCap('/index.php?m=Service&c=Center&a=getCustomer&id='+uid,'800px','600px');
		});
			//搜索
		$(document).on("click","#search",function(){
			var tel=$("#searchTel").val();
			var name=$("#searchName").val();
			window.location.href='/index.php?m=Service&c=Center&a=choice&tel='+tel+'&name='+name;
		});
	},
	/*·····························功能性函数························*/
	// iframe页面弹窗
	layerOpen:function(title,url){
		layer.open({
			type: 2,
			area: ['800px', '600px'],
			fix: false, //不固定
			maxmin: true,
			shade:0.4,
			title: title,
			content:url
		});
	},
	//创建用户
	layerCap:function(url,w,h){
		var w=(w)?w:'800px';
		var h=(h)?h:'400px';
		layer.open({
			type:2,
			shade: false,
		    title: false, //不显示标题
		    area: [w,h],
		    content: url, //捕获的元素
		    cancel: function(index){
		        
		    }
		});
	}
}
</script>
</body>
</html>